<template>
	<div id="login">
		<div class="login">
			<div class="a">
				<div class="content content1">
					<div class="logo">
						<h1>欢迎登录</h1>
					</div>
					<p>东哲博客</p>
				</div>
			</div>
			<div class="b">
				<el-tabs>
					<el-tab-pane label="登录">
						<div class="content">
							<el-form :model="user" :rules="users" ref="user">
								<el-form-item class="form-group" prop="username">
									<el-input placeholder="用户名" v-model="user.username" clearable
										class="input-material">
										<template slot="prepend">
											<i class="el-icon-user"></i>
										</template>
									</el-input>
								</el-form-item>
								<el-form-item class="form-group" prop="password">
									<el-input placeholder="密码" v-model="user.password" clearable show-password
										class="input-material">
									</el-input>
								</el-form-item>
								<!-- <div class="cc">
									<el-checkbox>记住密码</el-checkbox>
									<el-checkbox style="float: right;">自动登录</el-checkbox>
								</div> -->
								<el-button class="submitLogin" type="primary" @click="submitLogin" >登录</el-button>
								<p class="dd">
									第三方登录
									<a @click="qqLogin" title="qq登录" target="_blank"
										style="color: rgb(26, 182, 255);"><i class="iconfont iconqq"></i></a>
									<a style="float: right;" href="/">免登录</a>
								</p>
							</el-form>
						</div>
					</el-tab-pane>
					<el-tab-pane label="注册">
						<div class="content">
							<el-form :model="regist" :rules="regists" ref="regist">
								<el-form-item class="form-group email1" prop="email">
									<el-input placeholder="注册邮箱" v-model="regist.email" clearable
										class="pwd input-material email">
									</el-input>
									<el-tooltip v-show="regist.showSendYZM" class="item" effect="dark" content="发送验证码"
										placement="top-start">
										<el-button plain class="sendYZM" type="primary" @click="sendCodeToEmail()"><i
												class="el-icon-position"></i></el-button>
									</el-tooltip>
									<el-button v-show="!regist.showSendYZM" plain class="sendYZM" type="info">
										{{regist.time}}s</i>
									</el-button>
								</el-form-item>
								<el-form-item class="form-group" prop="username">
									<el-input placeholder="用户名" v-model="regist.username" clearable
										class="input-material">
										<template slot="prepend">
											<i class="el-icon-user"></i>
										</template>
									</el-input>
								</el-form-item>
								<el-form-item class="form-group" prop="password">
									<el-input placeholder="密码" v-model="regist.password" clearable show-password
										class="input-material pwd">
									</el-input>
								</el-form-item>
								<el-form-item class="form-group code" prop="code">
									<el-input style="width: 50%;" placeholder="验证码" v-model="regist.code" clearable
										class="input-material pwd">
									</el-input>
									<el-button class="sendYZM regist" type="primary" @click="register('regist')">立即注册
									</el-button>
								</el-form-item>
							</el-form>
						</div>
					</el-tab-pane>
				</el-tabs>
			</div>
		</div>
	</div>
</template>
<script>
	import login from '@/assets/js/login.js'
	export default {
	  name: 'login',
	  mixins: [
	    login
	  ],
	  mounted () {
	  },
	  beforeDestroy () {
	  }
	}
</script>
<style lang="less" src="@/assets/css/login.less"></style>
<style scoped lang="less" src="@/assets/css/login_sco.less"></style>
